home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb-4.5 / dist / gdb / copying.awk < prev    next >
Encoding:
AWK Script  |  1992-04-02  |  2.2 KB  |  77 lines

  1. BEGIN    {
  2.       FS="\"";
  3.       print "/* ==> Do not modify this file!!  It is created automatically";
  4.       print "   by copying.awk.  Modify copying.awk instead.  <== */";
  5.       print ""
  6.       print "#include <stdio.h>"
  7.       print "#include \"defs.h\""
  8.       print "#include \"command.h\""
  9.       print "#include \"gdbcmd.h\""
  10.       print ""
  11.       print "static void"
  12.       print "copying_info PARAMS ((char *, int));"
  13.       print ""
  14.       print "static void"
  15.       print "warranty_info PARAMS ((char *, int));"
  16.       print ""
  17.       print "extern int immediate_quit;";
  18.       print "static void";
  19.       print "copying_info (ignore, from_tty)";
  20.       print "     char *ignore;";
  21.       print "     int from_tty;";
  22.       print "{";
  23.       print "  immediate_quit++;";
  24.     }
  25. NR == 1,/^[     ]*NO WARRANTY[     ]*$/    {
  26.       if ($0 ~ / /)
  27.         {
  28.           printf "  printf_filtered (\"\\n\");\n";
  29.         }
  30.       else if ($0 !~ /^[     ]*NO WARRANTY[     ]*$/) 
  31.         {
  32.           printf "  printf_filtered (\"";
  33.           for (i = 1; i < NF; i++)
  34.         printf "%s\\\"", $i;
  35.           printf "%s\\n\");\n", $NF;
  36.         }
  37.     }
  38. /^[     ]*NO WARRANTY[     ]*$/    {
  39.       print "  immediate_quit--;";
  40.       print "}";
  41.       print "";
  42.       print "static void";
  43.       print "warranty_info (ignore, from_tty)";
  44.       print "     char *ignore;";
  45.       print "     int from_tty;";
  46.       print "{";
  47.       print "  immediate_quit++;";
  48.     }
  49. /^[     ]*NO WARRANTY[     ]*$/, /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/{  
  50.       if (! ($0 ~ /^[     ]*END OF TERMS AND CONDITIONS[     ]*$/)) 
  51.         {
  52.           printf "  printf_filtered (\"";
  53.           for (i = 1; i < NF; i++)
  54.         printf "%s\\\"", $i;
  55.           printf "%s\\n\");\n", $NF;
  56.         }
  57.     }
  58. END    {
  59.       print "  immediate_quit--;";
  60.       print "}";
  61.       print "";
  62.       print "void"
  63.       print "_initialize_copying ()";
  64.       print "{";
  65.       print "  add_info (\"copying\", copying_info,";
  66.       print "        \"Conditions for redistributing copies of GDB.\");";
  67.       print "  add_info (\"warranty\", warranty_info,";
  68.       print "        \"Various kinds of warranty you do not have.\");";
  69.       print "  add_cmd (\"copying\", no_class, copying_info,";
  70.       print "       \"Conditions for redistributing copies of GDB.\",";
  71.       print "       &showlist);";
  72.       print "  add_cmd (\"warranty\", no_class, warranty_info,";
  73.       print "       \"Various kinds of warranty you do not have.\",";
  74.       print "       &showlist);";
  75.       print "}";
  76.     }
  77.